﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>订单监控</title>
    <style type="text/css">
        .auto-style1 {
            width: 40px;
        }
    </style>
</head>
<body>
    <div class="pd-5">
        <div class="text-c" id="findfdiv">
            所在步骤:  
             <span class="select-box" style="width: 120px;">
                 <select class="select" name="findfnid_d" id="findfnid_d"></select></span>
            生日范围：
            <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'finddt1_timee\')||\'%y-%M-%d\'}'})" id="finddt1_times" name="finddt1_times" class="input-text Wdate" style="width: 120px;">
            -
            <input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'finddt1_times\')}',maxDate:'%y-%M-%d'})" id="finddt1_timee" name="finddt1_timee" class="input-text Wdate" style="width: 120px;">
            <input type="text" class="input-text" style="width: 250px" placeholder="生产编号" id="findorderMNo" name="findorderMNo">
            <button onclick="findreolad()" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 查找</button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-5">
            <span class="l">
                <a href="javascript:;" onclick="toolDelete()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
                <a href="javascript:;" onclick="toolUpdate()" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe6df;</i> 处理</a>
                <a href="javascript:;" onclick="toolAdd()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a></span>
            <span class="r">操作提示：<strong>^_^</strong> </span>

        </div>
        <div class="mt-5 ml-20">
            <table class="table table-border table-bordered table-striped table-hover" id="tablelist" width="100%">
                <thead>
                    <tr class="text-c">
                        <th width="30"><a id="hcmtable_sall" onclick="hcmtable_sall();" href="javascript:;" title="全选反选"><i class="Hui-iconfont">&#xe608;全</i></a></th>
                        <th>生产编号</th>
                        <th>产品名称</th>
                        <th>型号</th>
                        <th>数量</th>
                        <th>客户名称</th>
                        <th>交货日期</th>
                        <th>当前步骤</th>
                        <th>流程状态</th>
                        <th>操作时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../lib/datatables/1.10.0/jtable.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_list.js"></script>
    <script type="text/javascript" src="../js/hcrainwf.js"></script>
    <script type="text/javascript">
        $(function () {
            spsetBaseNoBt("order_sp", "id", "order_sp as T",
                "t.id, t.orderMNo, t.orderMName, t.orderMType, t.orderMCount, t.orderUserName, t.orderSendTime",
                "#tablelist", "hsflow", "订单监控", "hhwork");
            hcmtable = $("#tablelist").DataTable({
                "serverSide": true,//服务端处理分页 无法使用当前查找
                "bFilter": false,  //是否使用内置的过滤功能
                "bInfo": true, "fnDrawCallback": function () { dTappendSkipPage(); },
                "scrollX": true,
                //"ajax": spselUrl(" and type=20150921"),
                "ajax": {
                    "type": "POST",
                    "url": spselUrl_hf(" and type=20170514"),
                    "data": function (d) {
                        $("#findfdiv").find("input[type='text']").each(function () {
                            d[this.id] = $(this).val();
                        });
                        d["findfnid_d"] = $("#findfnid_d").val();
                    }
                },
                "order": [[0, "desc"]],//默认第几个排序
                aLengthMenu: [5, 10, 20, 50],
                "columns": [
                                     { "data": "id" }
, { "data": "orderMNo" }, { "data": "orderMName" }, { "data": "orderMType" }, { "data": "orderMCount" }, { "data": "orderUserName" }, { "data": "orderSendTime" }
, { "data": "hcrnname" }
, { "data": "hcrstates" }
, { "data": "hcrsetuptime" }
, { "data": "id" }
                ],

              //<th>生产编号</th>
              //          <th>产品名称</th>
              //          <th>型号</th>
              //          <th>数量</th>
              //          <th>客户名称</th>
              //          <th>交货日期</th>
              //          <th>当前步骤</th>
              //          <th>流程状态</th>
              //          <th>操作时间</th>
              //          <th>操作</th>

                "columnDefs": [

                    //特殊显示列
                    {
                        "targets": [8],
                        "render": function (data, type, row) {
                            if (data == "") return "";
                            else if (data == "已结束") return "<span class=\"label label-success  radius\">" + data + "</span>";
                            else if (data == "待发起") return "<span class=\"label label-primary  round\">" + data + "</span>";
                            else return "<span class=\"label label-danger\">" + data + "</span>";
                        }
                    }
                    ,
                   // 操作列
                    {
                        "targets": [10],
                        "render": function (data, type, row) {
                            return "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"showwork('" + data + "')\" href=\"javascript:;\" title=\"查看\"><i class=\"Hui-iconfont\">&#xe647;查看</i></a>"+"<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"toolUpdateByIdCheckUrl('" + data + "','" + row.fdourl + "')\" href=\"javascript:;\" title=\"处理\"><i class=\"Hui-iconfont\">&#xe647;处理</i></a> " +
                                   "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"toolDelete('" + data + "')\"     href=\"javascript:;\" title=\"删除\"><i class=\"Hui-iconfont\">&#xe6e2;删除</i></a>";
                            //"<a style=\"text-decoration:none\" onClick=\"toolUpdateById(" + data + ")\" href=\"javascript:;\" title=\"审核\">审核</a>" +
                        }
                    },

                    //不排序
                   {
                       "orderable": false,
                       "targets": [0, 1, 2, 3, 4, 5, 6, , 7, 8, 9, 10]
                   }
                ]
            });

            hcdosel("id,fnname as name", "hcr_w_next", "fdeid=6", "", "", "id", function (data) { SetSelectWithObjIdName("#findfnid_d", data); });

            //$("#tablelist tbody").on("click", ".edit-btn", function () {
            //    var tds = $(this).parents("tr").children();
            //    $.each(tds, function (i, val) {
            //        var jqob = $(val);
            //        if (i < 1 || jqob.has('button').length) { return true; }//跳过第1项 序号,按钮
            //        var txt = jqob.text();
            //        var put = $("<input type='text' class=\"input-text\">");
            //        put.val(txt);
            //        jqob.html(put);
            //    });
            //    $(this).html("保存");
            //    $(this).toggleClass("edit-btn");
            //    $(this).toggleClass("save-btn");
            //});

            //$("#tablelist tbody").on("click", ".save-btn", function () {
            //    var row = hcmtable.row($(this).parents("tr"));
            //    var tds = $(this).parents("tr").children();
            //    $.each(tds, function (i, val) {
            //        var jqob = $(val);
            //        //把input变为字符串
            //        if (!jqob.has('button').length) {
            //            var txt = jqob.children("input").val();
            //            jqob.html(txt);
            //            hcmtable.cell(jqob).data(txt);//修改DataTables对象的数据
            //        }
            //    });
            //    var data = row.data();
            //    $.ajax({
            //        "url": "/example/resources/user_share/inline_edit_no_plugin/edit.php",
            //        "data": data,
            //        "type": "post",
            //        "error": function () {
            //            alert("服务器未正常响应，请重试");
            //        },
            //        "success": function (response) {
            //            alert(response);
            //        }
            //    });
            //    $(this).html("编辑");
            //    $(this).toggleClass("edit-btn");
            //    $(this).toggleClass("save-btn");
            //});

        });

        function showwork(id) {
            toolUpdateById(id, "查看订单", "hhwork-show.html?action=edit&id=" + id, null, null);
           // toolAdd("新增组件", "hhwork-show.html?action=edit&id=" + id);
        }

    </script>
</body>
</html>
